#include "timer.h"

Timer::Timer(uint32_t id, int64_t when_ms, int64_t interval_ms, const TimerTask& handler)
    :m_id(id)
    ,m_task(handler)
    ,m_when_ms(when_ms)
    ,m_interval_ms(interval_ms)
    ,m_repeated(interval_ms>0)
{

}

void Timer::run()
{
    if (m_task)
    {
        m_task();
    }
}
